package com.dmjj.cad.service.impl;

import com.dmjj.cad.dao.CategoryMapper;
import com.dmjj.cad.dto.CategoryDTO;
import com.dmjj.cad.service.CategoryService;
import com.dmjj.cad.vo.CategoryVO;
import com.dmjj.cadcommon.base.BaseMapper;
import com.dmjj.cadcommon.base.BaseServiceImpl;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.stereotype.Service;
import java.util.List;


/**
 * 分类表业务处理接口
 * @Author zhangxue
 * @Date 2019-04-19 10:39:23
 */
@Service
public class CategoryServiceImpl extends BaseServiceImpl<CategoryDTO, Long> implements CategoryService {

    private static final Log LOGGER = LogFactory.getLog(CategoryServiceImpl.class);

    @Autowired
    private CategoryMapper mapper;

    @Override
    protected BaseMapper<CategoryDTO, Long> getMapper() {
        return mapper;
    }

    /**
     * 分类表列表
     * @Author zhangxue
     * @Date 2019-04-19 10:39:23
     * @Param
     * @Return
     */
    @Override
    public List<CategoryDTO> list4Page(CategoryDTO entity, Integer pageNum, Integer... pageSize) {
        return super.list4Page(entity, pageNum, pageSize);
    }

    /**
     * 分类表列表（无分页）
     * @Author zhangxue
     * @Date 2019-04-19 10:39:23
     * @Param
     * @Return
     */
    @Override
    public List<CategoryDTO> listByCondition(CategoryDTO entity) {
        return super.listByCondition(entity);
    }

    /**
     * 查询分类表详情信息
     * @Author zhangxue
     * @Date 2019-04-19 10:39:23
     * @Param
     * @Return
     */
    @Override
    public CategoryDTO queryOneByPk(Long id) {
        return super.queryOneByPk(id);
    }

    /**
     * 保存分类表信息
     * @Author zhangxue
     * @Date 2019-04-19 10:39:23
     * @Param
     * @Return
     */
    @Override
    @Transactional
    public Long save(CategoryDTO entity) {
        return super.save(entity);
    }

    /**
     * 删除分类表信息
     * @Author zhangxue
     * @Date 2019-04-19 10:39:23
     * @Param
     * @Return
     */
    @Override
    @Transactional
    public Integer delete(Long id) {
        return super.delete(id);
    }

    @Override
    public CategoryDTO queryOneByEntity(CategoryDTO paramentity) {
        return mapper.queryOneByEntity(paramentity);
    }
}
